package com.slz3.business.module.memberManagement.memCollect.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memCollect.domain.MemCollect;
import com.slz3.business.module.memberManagement.memCollect.domain.MemCollectCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemCollectResAtomic {

    static Mono<ServerResponse> add_$MemCollectUpdateLock(ServerRequest req, MemCollect memCollect) {
        return MemCollectResSafeValid.add(req, memCollect) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.add(req, memCollect);
    }

    public static Mono<ServerResponse> delete_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.delete(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$MemCollectUpdateLock(ServerRequest req, MemCollect memCollect) {
        return MemCollectResSafeValid.modify(req, memCollect) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.modify(req, memCollect);
    }

    static Mono<ServerResponse> info_$MemCollectUpdateLock(ServerRequest req) {
        return MemCollectResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.auditSubmit(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.audit(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.auditReject(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.usingEnable(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$MemCollectUpdateLock(ServerRequest req, MemCollectCondition memCollectCondition) {
        return MemCollectResSafeValid.usingDisable(req, memCollectCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemCollectResExecutor.usingDisable(req);
    }
}
